
package com.provafinal.dao;

import com.provafinal.entity.Agenda;
import java.util.List;
import javax.persistence.Query;


public class AgendaDAO extends DAO {

    public List<Agenda> listasAgenda() {
        Query q = criaQuery("SELECT a FROM Agenda a ORDER BY a.nome");
        return q.getResultList();
    }
    public List<Agenda> pisquisarContato(String nome) {
        Query q = criaQuery("SELECT a FROM Agenda a WHERE a.nome LIKE '%"+nome+"%' ORDER BY a.nome");
        return q.getResultList();
    }
}
